<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    
    <div id="app">
        <ul>
            <li v-for="user in users">
                {{user.name}} - {{user.gender}} - {{user.age}}
                <!-- 1. 显示 user 信息：v-for="item in items" -->
                <!-- 2. 获取数组下标：v-for="(item,index) in items" -->
                <!-- 3. 遍历对象：
                        v-for="value in object"
                        v-for="(value, key) in object"
                        v-for="(value,key,index) in object"
                 -->
                 <!-- 4. 遍历的时候都加上：key  -->
            </li>
        </ul><p />
        <button v-on:click="show = !show">点我啊</button><br/>
        <h1 v-if="show">
            看到我啦？！
        </h1>
        <h1 v-show="show">
            看到我啦？！
        </h1><p/>
        <button v-on:click="random=Math.random()">点我呀</button>
        <span>{{random}}</span>
        <h1 v-if="random >= 0.75">
            看到我啦？！v-if >= 0.75
        </h1>
        <h1 v-else-if="random > 0.5">
            看到我啦？！v-else-if > 0.5
        </h1>
        <h1 v-else-if="random > 0.25">
            看到我啦？！v-else-if > 0.25
        </h1>
        <h1 v-else>
            看到我啦？！v-else
        </h1>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el: "#app",
            data: {
                users: [
                    { name: '柳岩', gender: '女', age: 21 },
                    { name: '张三', gender: '男', age: 18 },
                    { name: '范冰冰', gender: '女', age: 24 },
                    { name: '刘亦菲', gender: '女', age: 18 },
                    { name: '古力娜扎', gender: '女', age: 25 }
                ],
                show: true,
                random: 1
            }
        })
    </script>
</body>
</html>